package com.hyts.apilog.handler;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

/**
 * project-name:coffice-toolbox
 * package-name:com.hyts.apilog.handler
 * author:Libo/Alex
 * create-date:2019-06-15 21:46
 * copyright:libo-hyts-github
 * email:libo2dev@aliyun.com
 * description:此类主要用于: 基础面向切面的处理器操作接口-主要面向于aspectj服务spring ltw服务功能实现
 */

public interface BaseAspectHandler {

    /**
     * before 前置处理操作
     * @param joinPoint
     * @throws Throwable
     */
    void before(JoinPoint joinPoint) throws Throwable;

    /**
     * after 后置处理操作
     * @param joinPoint
     * @throws Throwable
     */
    void after(JoinPoint joinPoint) throws Throwable;

    /**
     * 后置返回的处理器操作
     * @param joinPoint
     * @param returnObj
     * @throws Throwable
     */
    void afterReturning(JoinPoint joinPoint, Object returnObj) throws Throwable;

    /**
     * 抛出异常的后置处理器操作
     * @param joinPoint
     * @param e
     * @throws Throwable
     */
    void afterThrowing(JoinPoint joinPoint, Throwable e) throws Throwable;

    /**
     * 环绕操作服务处理操作
     * @param pJoinPoint
     * @return
     * @throws Throwable
     */
    Object around(ProceedingJoinPoint pJoinPoint) throws Throwable;
}
